package Main;
import java.util.Scanner;
public class Main2 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()){
			int a;
			a=sc.nextInt();
			if(a>=10000&&a<=20000){
				 String B =Integer.toBinaryString(a);
				 String C=Integer.toOctalString(a);
				 String D=Integer.toHexString(a);
				 System.out.println(B+","+C+","+D);
				}
			else {
				if(a<0){
					a=-a;
					}
				String A = Integer.toString(a);
				char[] E=A.toCharArray();
				int d=0;
        		for(int i=0;i<E.length;i++)
        		{
        			System.out.print(E[i]+" ");
        			d=d+Integer.parseInt(String.valueOf(E[i]));
        		}
				System.out.println(d);
				}
		}

	}

}
